import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
import org.junit.jupiter.params.provider.CsvSource;

import static org.junit.jupiter.api.Assertions.assertEquals;

/***
 *
 * @author wuchenran
 * @date 2023年3月24日-下午7:30:19
 * @description 三角形测试用例
 */
class TriangleTest2 {

    Triangle triangle = new Triangle();

    @ParameterizedTest
    @CsvSource
            ({ "0,1,2,输入错误","3,4,5,不等边三角形", "5,5,5,等边三角形", "1,2,3,非三角形","4,3,3,等腰三角形" })
    void paramTriangle(int a, int b,int c,String expected)
    {
        String type = triangle.classify(a, b, c);
        assertEquals(expected, type);
    }

    @DisplayName("一般边界值方法")
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle-1.csv")
    void test_csv_file_source(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }

    @DisplayName("健壮性边界值方法")
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle-2.csv")
    void test_csv_file_source2(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }

    @DisplayName("最坏情况一般边界值分析方法")
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle-3.csv")
    void test_csv_file_source3(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }

    @DisplayName("最坏情况健壮性边界值分析方法")
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle-4.csv")
    void test_csv_file_source4(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }

}